|
|
Chris Huff wrote:
> ...
> You don't need a macro for this, a plain old function will do fine.
>
> #declare Heaviside = function {if(x - y, 1, 0)}
> // x=the value, y=the jump threshold, z=nothing
> ...
Agreed. But I think the best solution to Libellule problem should be
something like
#macro Heaviside(jump)
if(x - jump, 1, 0)
#end
isosurface{function{y - Heaviside(actual_jump)}
contained_by{box -<1, 1, 1> <1, 1, 1>}
accuracy .01
max_gradient 21
}
where actual_jump is a constant float.
In this way, if you need more than one step function with jumps at
distinct places in the same isosurface, this would be the optimal
implementation. I tried this code but got an error message
error: float factor expected but macro identifier found instead.
So macro substitution doesn't work inside function{...}. I thought that
at parse time, this macro substitution would take effect.
Is that a MegaPov misbehavior or is this intended for some reason?
Regards, Alberto.
Post a reply to this message
|
|